package com.liuya.common;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

/**
 * 解决HashMap的values()方法在没有值的情况下，创建一个Values做为填充值造成的序列化异常问题。
 * @author liuya
 * @date 20160928
 */
public class MyHashMap<K,V> extends HashMap<K,V> {

    public MyHashMap(int initialCapacity, float loadFactor) {
        super(initialCapacity, loadFactor);
    }

    public MyHashMap(int initialCapacity) {
        super(initialCapacity);
    }

    public MyHashMap() {
        super();
    }

    public MyHashMap(Map<? extends K, ? extends V> m) {
        super(m);
    }

    public Collection values() {
        Collection vs = super.values();
        return new ArrayList(vs);
    }

}
